<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<style type="text/css">
  .Untread_TaskListClass{
	   border:dashed thin #cbcbcb;
	   height:16px;
  }
</style>
<script type="text/javascript">
   //鼠标移入效果
   function onMouseOver(obj){
	   $(obj).css({"color":"#398ece"});
   }
   //鼠标移出效果
   function onMouseOut(obj){
	   $(obj).css({"color":"#666666"});
   }
   //是否显示更多
   function showOrhideMore(idx,ifx){
	   if(idx==1){//显示更多
		   $("#showOrhideMore_divId"+ifx).css("visibility","visible");
	   }else{//隐藏更多
		   $("#showOrhideMore_divId"+ifx).css("visibility","hidden"); 
	   }
   }
    //处理问题
	function dealProblem(problemId,taskId,executionId){		
		var pars="problemId="+problemId+"&taskId="+taskId+"&executionId="+executionId;
       window.top.$('<div/>').dialog({
			href:'${pageContext.request.contextPath}/problemmgr/problemAction!toDealProblemPage.action?'+pars,
			top:($(window).height()-250)*0.5,
		    left:($(window).width()-300)*0.5,
			width:700,
			modal:true,
			title:'   ',
			buttons:[{
				text:'处 理',
				iconCls:'',
				handler:function(){
					
					var d=window.top.$(this).closest('.window-body');
					window.top.$('#problem_deal_form').form('submit',{
						url:'${pageContext.request.contextPath}/problemmgr/problemAction!dealProblem.action',
						data:pars,
						success:function(result){
							//加载待办任务列表数据
							$("#framework_firstpage_taskListDivId").load("${pageContext.request.contextPath}/firstPageAction!getTaskList.action",function(){});
							try {
								var r = $.parseJSON(result);
								$.messager.show({
									title : '提示',
									msg : r.returnMsg
								});
								if (r.returnFlag) {
									d.dialog('destroy');
									pars='';
									getDatagridByID();
								}
								
							} catch (e) {
								$.messager.show({
									title : '提示',
									msg : r.returnMsg
								});
							}
							}
						});
					}
				}],
			onClose:function(){
				window.top.$(this).dialog('destroy');
			}
		});
       
	}
    //进入问题处理页面
    function MoreDealList(problemLevel){
    	var pars="warnLevel="+problemLevel;
        window.top.$('<div style="overflow-y:hidden"/>').dialog({
 			href:'${pageContext.request.contextPath}/firstPageAction!toProblemDealList.action?'+pars,
 			width:1000,
 			height:470,
 			modal:true,
 			title:'问题处理页面',
 			onClose:function(){
 				window.top.$(this).dialog('destroy');
 			}
 		});
    }
</script>
<table width="100%">
     <tr>
	    <td style="width:100%;height:30px" colspan="2" valign="top" nowrap="nowrap">
	       <img title="查看待办任务列表" src="${pageContext.request.contextPath}/images/firstpage/untread_tasklist.png" style="width:28px;height:28px;margin-top:2px;margin-left:5px;float:left"/>
	       <div style="font-size:15px;margin-top:8px;float:left">&nbsp;待办任务列表</div>
	    </td>
	 </tr>
	 <tr>
	    <td style="width:100%;height:65px" colspan="2" valign="top" nowrap="nowrap">
	        <table width="95%" class="Untread_TaskListClass" style="margin-left:10px;margin-right:10px;margin-top:2px;margin-bottom:2px;">
	             <tr>
	                <td style="width:20%;height:66px;border-right:dashed thin #cbcbcb;">
	                    <div style="text-align:center;"><img title="紧急任务" src="${pageContext.request.contextPath}/images/firstpage/urgency_task.png" style="width:33px;height:33px;"/></div></br>
	                    <div style="text-align:center;">紧急任务</div>
	                </td>
	                <td style="width:80%;height:66px;cursor:pointer" onmouseover="showOrhideMore(1,3)" onmouseout="showOrhideMore(2,3)" valign="top">
	                           <table style="width:100%;height:66px;">
	                         <c:choose>
						        <c:when test="${!empty listMap.urgency_task}">
						            <c:forEach items="${listMap.urgency_task}" var="list" varStatus="g" step="1">
					                      <c:if test="${g.count<3}">
					                         <tr>
					                            <td style="width:100%;" colspan="2">
					                                <div onclick="dealProblem('${list.problemId}','${list.taskId}','${list.executionId}')"  onmouseover="onMouseOver(this)" onmouseout="onMouseOut(this)" style="cursor:pointer;width:220px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#666666" title="${list.title}">&nbsp;<font style="font-size:15px;">▪</font>&nbsp;${list.title}</div>
					                            </td>
									         </tr>
									      </c:if>
									      <c:if test="${g.count==3}">
								            <tr>
					                            <td style="width:80%">
					                                <div onclick="dealProblem('${list.problemId}','${list.taskId}','${list.executionId}')"  onmouseover="onMouseOver(this)" onmouseout="onMouseOut(this)" style="cursor:pointer;width:220px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#666666" title="${list.title}">&nbsp;<font style="font-size:13px;">▪</font>&nbsp;${list.title}</div>
					                            </td>
					                            <td style="width:46px;height:19px;" align="right"><div onclick="MoreDealList(3)" id="showOrhideMore_divId3" style="background:url('${pageContext.request.contextPath}/images/firstpage/more_bg.png');width:46px;height:19px;text-align:center;line-height:19px;visibility:hidden;">更多</div></td>
								            </tr>
									      </c:if>
								     </c:forEach>
						      </c:when>
						      <c:otherwise>
						          <tr>
						              <td colspan="2" style="width:100%;height:66px;text-align:center"><div style="font-weight:600;color:#398ece">暂无待处理任务</div></td>
						          </tr>
						      </c:otherwise>
                         </c:choose>
                       </table>
	                </td>
	             </tr>
	        </table>
	    </td>
	 </tr>
	 <tr>
	    <td style="width:100%;height:65px" colspan="2" valign="top" nowrap="nowrap">
	        <table width="95%" class="Untread_TaskListClass" style="margin-left:10px;margin-right:10px;margin-top:2px;margin-bottom:2px;">
	             <tr>
	                <td style="width:20%;height:66px;border-right:dashed thin #cbcbcb;">
	                    <div style="text-align:center;"><img  title="重要任务" src="${pageContext.request.contextPath}/images/firstpage/important_task.png" style="width:33px;height:33px;"/></div></br>
	                    <div style="text-align:center;">重要任务</div>
	                </td>
	                <td style="width:80%;height:66px;cursor:pointer;" onmouseover="showOrhideMore(1,2)" onmouseout="showOrhideMore(2,2)" valign="top">
	                     <table style="width:100%;height:66px;">
	                         <c:choose>
						        <c:when test="${!empty listMap.important_task}">
						            <c:forEach items="${listMap.important_task}" var="list" varStatus="g" step="1">
					                      <c:if test="${g.count<3}">
					                         <tr>
					                            <td style="width:100%" colspan="2">
					                                <div onclick="dealProblem('${list.problemId}','${list.taskId}','${list.executionId}')"  onmouseover="onMouseOver(this)" onmouseout="onMouseOut(this)" style="cursor:pointer;width:220px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#666666" title="${list.title}">&nbsp;<font style="font-size:15px;">▪</font>&nbsp;${list.title}</div>
					                            </td>
									         </tr>
									      </c:if>
									      <c:if test="${g.count==3}">
								            <tr>
					                            <td style="width:80%">
					                                <div onclick="dealProblem('${list.problemId}','${list.taskId}','${list.executionId}')"  onmouseover="onMouseOver(this)" onmouseout="onMouseOut(this)" style="cursor:pointer;width:220px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#666666" title="${list.title}">&nbsp;<font style="font-size:13px;">▪</font>&nbsp;${list.title}</div>
					                            </td>
					                            <td style="width:46px;height:19px;" align="right"><div onclick="MoreDealList(2)" id="showOrhideMore_divId2" style="background:url('${pageContext.request.contextPath}/images/firstpage/more_bg.png');width:46px;height:19px;text-align:center;line-height:19px;visibility:hidden;">更多</div></td>
								            </tr>
									      </c:if>
								     </c:forEach>
						      </c:when>
						      <c:otherwise>
						          <tr>
						              <td colspan="2" style="width:100%;height:66px;text-align:center"><div style="font-weight:600;color:#398ece">暂无待处理任务</div></td>
						          </tr>
						      </c:otherwise>
                         </c:choose>
                       </table>
	                </td>
	             </tr>
	        </table>
	    </td>
	 </tr>
	 <tr>
	    <td style="width:100%;height:65px" colspan="2" valign="top" nowrap="nowrap">
	        <table width="95%" class="Untread_TaskListClass" style="margin-left:10px;margin-right:10px;margin-top:2px;margin-bottom:2px;">
	             <tr>
	                <td style="width:20%;height:66px;border-right:dashed thin #cbcbcb;">
	                    <div style="text-align:center;"><img title="一般任务" src="${pageContext.request.contextPath}/images/firstpage/general_task.png" style="width:33px;height:33px;"/></div></br>
	                    <div style="text-align:center;">一般任务</div>
	                </td>
	                <td style="width:80%;height:66px;cursor:pointer" onmouseover="showOrhideMore(1,1)" onmouseout="showOrhideMore(2,1)" valign="top">
	                     <table style="width:100%;height:66px;">
	                         <c:choose>
						        <c:when test="${!empty listMap.general_tasklist}">
						            <c:forEach items="${listMap.general_tasklist}" var="list" varStatus="g" step="1">
					                      <c:if test="${g.count<3}">
					                         <tr>
					                            <td style="width:100%" colspan="2">
					                               <div onclick="dealProblem('${list.problemId}','${list.taskId}','${list.executionId}')"  onmouseover="onMouseOver(this)" onmouseout="onMouseOut(this)" style="cursor:pointer;width:220px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#666666" title="${list.title}">&nbsp;<font style="font-size:15px;">▪</font>&nbsp;${list.title}</div>
					                            </td>
									         </tr>
									      </c:if>
									      <c:if test="${g.count==3}">
								            <tr>
					                            <td style="width:80%">
					                                <div onclick="dealProblem('${list.problemId}','${list.taskId}','${list.executionId}')"  onmouseover="onMouseOver(this)" onmouseout="onMouseOut(this)" style="cursor:pointer;width:220px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#666666" title="${list.title}">&nbsp;<font style="font-size:13px;">▪</font>&nbsp;${list.title}</div>
					                            </td>
					                            <td style="width:46px;height:19px;" align="right"><div  onclick="MoreDealList(1)" id="showOrhideMore_divId1" style="background:url('${pageContext.request.contextPath}/images/firstpage/more_bg.png');width:46px;height:19px;text-align:center;line-height:19px;visibility:hidden;">更多</div></td>
								            </tr>
									     </c:if>
								     </c:forEach>
						      </c:when>
						      <c:otherwise>
						          <tr>
						              <td colspan="2" style="width:100%;height:66px;text-align:center"><div style="font-weight:600;color:#398ece">暂无待处理任务</div></td>
						          </tr>
						      </c:otherwise>
                         </c:choose>
                       </table>
	                </td>
	             </tr>
	        </table>
	    </td>
	 </tr>
</table>
